package xyz.chaobei.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.chaobei.entity.OrgUserRoleEntity;
import xyz.chaobei.mapper.OrgUserRoleMapper;
import xyz.chaobei.service.OrgUserRoleService;

import java.util.List;

/**
 * 用户与角色关联Service
 *
 * @author mrc
 * @Data 2020-08-02 10:33:30
 */
@Service
public class OrgUserRoleServiceImpl extends ServiceImpl<OrgUserRoleMapper, OrgUserRoleEntity> implements OrgUserRoleService {

    @Override
    public List<OrgUserRoleEntity> findByUserId(Integer id) {

        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("user_id_", id);

        List<OrgUserRoleEntity> result = baseMapper.selectList(wrapper);

        return result;
    }
}